import requests
# r = requests.get("https://www.baidu.com")
# #状态码
# print(r.status_code)
# # #响应体
# print(r.text)
# # # print(r.json())
# # #打印响应头
# print(r.headers)

# get = requests.get("https://www.baidu.com")
# post = requests.post("https://www.baidu.com")
#
# req_get = requests.request("get","https://www.baidu.com")
# #传递参数时指定参数
# req_post = requests.request(method="post",url="https://www.baidu.com")
# # req_post = requests.request(url="https://www.baidu.com",method="POST")
#
# print("get:",get)
# print("post:",post)
# print("req_get:",req_get)
# print("req_post:",req_post)

#请求博客详情页接口
#必须要先登录---在请求头添加用户登录凭证（User_token_header)
#带有参数
# url = "http://8.137.19.140:9090/blog/getBlogDetail?blogId=15686"
#这里的get请求，url上拼接的参数也可以单独拿下来写
# url = "http://8.137.19.140:9090/blog/getBlogDetail"
#
# param = {
#     "blogId":15686
# }
#
# #定义请求头
# header = {
#     "User_token_header":"eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwidXNlck5hbWUiOiJ6aGFuZ3NhbiIsImV4cCI6MTc0MDAyNTE2MX0.vbujuCAUkChZVWFmXiH4w4T1_DFv7C_g_hMtx873v_A"
# }
#
# r = requests.request(method="GET",url=url,params=param,headers=header)
# print(r.json())

#博客系统登录接口
#POST 表单格式
# url = "http://8.137.19.140:9090/user/login"
#
# data = {
#     "username":"lisi",
#     "password":"123456"
# }
#
# r = requests.request(method="POST",url=url,data=data)
# print(r.json())


#博客园用户详情页
#添加用户登录凭证--cookie（.Cnblogs.AspNetCore.Cookies）

# url = "https://account.cnblogs.com/user/userinfo"
#
# cookie = {
#     ".Cnblogs.AspNetCore.Cookies":"CfDJ8KL9kPW-LSFBi_9YdTzcC08XCItelbe4irfXxh-_hmXnNBYIpKioLVHPniZ2Cx5_Y1UtiUo_6eNEdT3wppoRwqpaV_fXKi7mJzn12_u9YMEr_2IyNRAzZ4ulRWtylki3GHehwaRdnzwbcK2-iWsmNw9nz8FPnaBCApdQDS9FR8T4ddhO23pVl2H2_21tA5Rexfqg1GqdIhsqVQW0-tTIuKIMQFVXWkO6Ym2OMGeZpjZxS78aHInaPzdG5CXNSAlauBD2YgjQ85dw9XOr3BPhwALoSR0K0eLrbEu1IvAETwmwqu3SlQmdohLgOl5AzDYmdpTpXkoKR4AOTyrm0Ve2QZM8ikMBY4qRL-n3yAxu1psc-gfoF842tshikHpHrPlTK_oLnIIqnvlrMQ-f53lhGdwiirXmCLS6BaphK88n8VSc4l2s9vU6SZbfqEzp3-GmWLFoOpFne1CUldXJcB949pfUH_eRFiFt9oGI5-U52yJwjc3Pn_qEFspG_XxjHKuBW2SI01T3AtBTDEOi4bZNuwYw3QU2W7rK7KFlhI0TWo9mzGBxOP0Fpix6EqRORJYVPU7oNttBNicK_y2IMLJSu5w;"
# }
#
# r = requests.request(method="GET",url=url,cookies=cookie)
#
#
# print(r.text)
#
#
# def test_01():
#     print("test01_test_01")